home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Video
/
World of Video.iso
/
gfxprograms
/
3dprograms
/
t3dlib
/
source
/
readlwob.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-13
|
19KB
|
694 lines
/* readlwob.c - read a LightWave3D object file into the internal database
* - written by Glenn M. Lewis - 8/7/92
*/
static char rcs_id[] = "$Id: readlwob.c,v 1.7 1993/02/14 07:27:06 glewis Exp $";
#include <stdio.h>
#include <ctype.h>
#include "t3dlib.h"
#ifdef __STDC__
#include <stdlib.h>
#include <strings.h>
#include "readlwob_protos.h"
#endif
#define MAXLINE 132
extern int verbose_flag;
static void process_DESC();
static OBJECT *process_EXTR();
static void process_INFO();
static void process_OBJ();
/* Here are a few necessary utilities */
static void get_name(name, size, world)
register char *name;
register int size;
WORLD *world;
{
while (size--) *name++ = fgetc(world->inp);
*name = '\0';
}
static BYTE get_BYTE(world)
WORLD *world;
{
return((BYTE)fgetc(world->inp));
}
static UBYTE get_UBYTE(world)
WORLD *world;
{
return((UBYTE)fgetc(world->inp));
}
static WORD get_WORD(world)
WORLD *world;
{
WORD tmp = (WORD)get_UBYTE(world)<<8;
return((WORD)(tmp|get_UBYTE(world)));
}
static UWORD get_UWORD(world)
WORLD *world;
{
UWORD tmp = (UWORD)get_UBYTE(world)<<8;
return((UWORD)(tmp|get_UBYTE(world)));
}
static ULONG get_ULONG(world)
WORLD *world;
{
ULONG tmp = (ULONG)get_UWORD(world)<<16;
return(tmp|get_UWORD(world));
}
static double get_FRACT(world) /* This sets the precision to 10^(-3) */
WORLD *world;
{
register double whole, fract;
whole = (double)get_WORD(world);
fract = ((double)get_UWORD(world))/65536.0;
return((double)(whole+fract));
}
static void stuff_XYZ(st, world)
XYZ_st *st;
WORLD *world;
{
st->x = get_FRACT(world);
st->y = get_FRACT(world);
st->z = get_FRACT(world);
}
static void stuff_RGB(st, world)
RGB_st *st;
WORLD *world;
{
st->r = get_UBYTE(world);
st->g = get_UBYTE(world);
st->b = get_UBYTE(world);
}
static void output_warning(world, area, name, size)
WORLD *world;
char *area, *name;
ULONG size;
{
ULONG i;
int j;
unsigned char tmpstr[20];
fprintf(stderr, "WARNING: Unknown %ssub-chunk: '%s', size %lu...\n",
area, name, size);
for (i=0; i<size; i+=16) {
fprintf(stderr, "%04lx:", i);
for (j=0; j<16 && i+j<size; j++)
fprintf(stderr, " %02x", tmpstr[j] = (fgetc(world->inp)&0xff));
while (j++ < 16) fputs(" ", stderr);
fputs(" ", stderr);
/* Print out the ASCII equivalent */
for (j=0; j<16 && i+j<size; j++) {
tmpstr[j] &= 0x7F; /* Strip off upper bit */
if (isprint(tmpstr[j]))
fputc(tmpstr[j], stderr);
else fputc('.', stderr);
}
fputs("\n", stderr);
}
}
/********************/
/* The MAIN section */
/********************/
extern int already_read_header;
extern unsigned char header_storage[13];
WORLD *read_LWOB(file)
FILE *file;
{
register ULONG i, len, size;
WORLD *world;
char name[5];
if (!file) return(0L); /* File not open */
if (!(world = (WORLD*)malloc(sizeof(WORLD)))) { OUT_MEM("WORLD"); }
bzero((char*)world, sizeof(WORLD));
world->inp = file;
if (!already_read_header) {
/* Parse the IFF TDDD file */
get_name(name, 4, world);
if (strcmp(name, "FORM") != 0) {
fprintf(stderr, "ERROR: Input is not an IFF file.\n"); exit(-1); }
if (!(len = get_ULONG(world))) {
fprintf(stderr, "ERROR: Bad FORM length in IFF file.\n"); exit(-1); }
get_name(name, 4, world);
if (strcmp(name, "LWOB") != 0) {
fprintf(stderr, "ERROR: IFF file is not a LWOB file.\n"); exit(-1); }
} else {
len = (header_storage[4]<<24) | (header_storage[5]<<16) |
(header_storage[6]<< 8) | (header_storage[7] );
already_read_header = 0;
}
len -= 4;
/* Here is the main loop: */
while (len>0) {
get_name(name, 4, world);
size = get_ULONG(world);
len -= 8;
if (strcmp(name, "INFO")==0) process_INFO(size, world);
else
if (strcmp(name, "OBJ ")==0) process_OBJ(size, world);
else {
if (verbose_flag) output_warning(world, "", name, size);
else {
for (i=size; i--; ) fgetc(world->inp); /* Skip this section */
}
}
if (size&1) { fgetc(world->inp); len--; } /* Skip odd byte */
len -= size;
}
/* All done. */
return(world);
}
static void process_INFO(len, world)
register ULONG len;
WORLD *world;
{
register INFO *info;
register ULONG i, size;
char name[5];
if (world->info) {
fputs("ERROR: More than one INFO chunk!\n", stderr); exit(-1); }
if (!(info = world->info = (INFO*)malloc(sizeof(INFO)))) { OUT_MEM("INFO"); }
bzero((char*)world->info, sizeof(INFO));
if (verbose_flag>1) fprintf(stderr, "INFO chunk.\n");
while (len>0) {
get_name(name, 4, world);
size = get_ULONG(world);
len -= 8;
if (verbose_flag>1) fprintf(stderr, "%s chunk.\n", name);
if (strcmp(name, "BRSH")==0) {
i = get_UWORD(world);
if (i<0 || i>7) { i=0; fputs("BRSH error.\n", stderr); }
get_name(info->brsh[i], 80, world);
} else
if (strcmp(name, "STNC")==0) {
i = get_UWORD(world);
if (i<0 || i>7) { i=0; fputs("STNC error.\n", stderr); }
get_name(info->stnc[i], 80, world);
} else
if (strcmp(name, "TXTR")==0) {
i = get_UWORD(world);
if (i<0 || i>7) { i=0; fputs("TXTR error.\n", stderr); }
get_name(info->txtr[i], 80, world);
} else
if (strcmp(name, "OBSV")==0) {
if (!info->obsv) info->obsv=(OBSV*)malloc(sizeof(OBSV));
if (!info->obsv) { OUT_MEM("OBSV"); }
stuff_XYZ(&info->obsv->came, world);
stuff_XYZ(&info->obsv->rota, world);
info->obsv->foca = get_FRACT(world);
} else
if (strcmp(name, "OTRK")==0) {
get_name(info->otrk, 18, world);
} else
if (strcmp(name, "OSTR")==0) {
if (!info->ostr) info->ostr=(STRY*)malloc(sizeof(STRY));
if (!info->ostr) { OUT_MEM("OSTR"); }
get_name(info->ostr->path, 18, world);
stuff_XYZ(&info->ostr->tran, world);
stuff_XYZ(&info->ostr->rota, world);
stuff_XYZ(&info->ostr->scal, world);
info->ostr->info = get_UWORD(world);
} else
if (strcmp(name, "FADE")==0) {
if (!info->fade) info->fade=(FADE*)malloc(sizeof(FADE));
if (!info->fade) { OUT_MEM("FADE"); }
info->fade->at = get_FRACT(world);
info->fade->by = get_FRACT(world);
fgetc(world->inp); /* Skip a byte */
stuff_RGB(&info->fade->to, world);
} else
if (strcmp(name, "SKYC")==0) {
if (!info->skyc) info->skyc=(SKYC*)malloc(sizeof(SKYC));
if (!info->skyc) { OUT_MEM("SKYC"); }
fgetc(world->inp); /* Skip a byte */
stuff_RGB(&info->skyc->hori, world);
fgetc(world->inp); /* Skip a byte */
stuff_RGB(&info->skyc->zeni, world);
} else
if (strcmp(name, "AMBI")==0) {
if (!info->ambi) info->ambi=(RGB_st*)malloc(sizeof(RGB_st));
if (!info->ambi) { OUT_MEM("AMBI"); }
fgetc(world->inp); /* Skip a byte */
stuff_RGB(info->ambi, world);
} else
if (strcmp(name, "GLB0")==0) {
if (!info->glb0) info->glb0=(BYTE*)malloc(8*sizeof(BYTE));
if (!info->glb0) { OUT_MEM("GLB0"); }
for (i=0; i<8; i++)
info->glb0[i] = get_UBYTE(world);
} else {
if (verbose_flag) output_warning(world, "INFO ", name, size);
else {
for (i=size; i--; ) fgetc(world->inp); /* Skip this section */
}
}
if (size&1) { fgetc(world->inp); len--; } /* Skip odd byte */
len -= size;
}
}
static void process_OBJ(len, world)
register ULONG len;
WORLD *world;
{
register ULONG i, size;
register OBJECT *p;
char name[5];
int depth=0;
if (verbose_flag>1) fprintf(stderr, "OBJ chunk.\n");
while (len>0) {
get_name(name, 4, world);
size = get_ULONG(world);
len -= 8;
if (verbose_flag>1) fprintf(stderr, "%s chunk.\n", name);
if (strcmp(name, "EXTR")==0) {
p = process_EXTR(size, create_object(), world);
if (world->curobj) {
world->curobj->next = p;
p->parent = world->curobj->parent;
} else {
world->object = p;
p->parent = 0;
}
world->curobj = p;
} else if (strcmp(name, "DESC")==0) {
p = create_object();
if (world->num_DESC > world->num_TOBJ+depth) { /* This is a child */
depth++; /* Down one in the hierarchy */
world->curobj->child = p;
p->parent = world->curobj;
} else {
if (world->curobj) {
world->curobj->next = p;
p->parent = world->curobj->parent;
} else {
world->object = p;
p->parent = 0;
}
}
world->curobj = p;
process_DESC(size, &p->desc, world);
} else if (strcmp(name, "TOBJ")==0) {
world->num_TOBJ++;
if (world->num_TOBJ > world->num_DESC) {
fprintf(stderr, "Warning: TOBJ without DESC. Ignored.\n");
}
if (world->num_TOBJ+depth > world->num_DESC) { /* Up a level */
depth--;
world->curobj=world->curobj->parent;
}
} else {
if (verbose_flag) output_warning(world, "OBJ ", name, size);
else {
for (i=size; i--; ) fgetc(world->inp); /* Skip this section */
}
}
if (size&1) { fgetc(world->inp); len--; } /* Skip odd byte */
len -= size;
}
}
static OBJECT *process_EXTR(len, obj, world)
register ULONG len;
OBJECT *obj;
WORLD *world;
{
register ULONG i, size;
register EXTR *extr;
register OBJECT *p;
char name[5];
MTRX *mtrx;
WORLD *new;
FILE *newinp;
if (!(extr = obj->extr = (EXTR*)malloc(sizeof(EXTR))))
{ OUT_MEM("EXTR"); }
bzero((char*)extr, sizeof(EXTR));
mtrx = &extr->mtrx;
/* Initialize structure */
mtrx->tran.x = mtrx->tran.y = mtrx->tran.z = 0.0;
mtrx->scal.x = mtrx->scal.y = mtrx->scal.z = 1.0;
mtrx->rota1.y = mtrx->rota1.z = 0.0;
mtrx->rota2.x = mtrx->rota2.z = 0.0;
mtrx->rota3.x = mtrx->rota3.y = 0.0;
mtrx->rota1.x = mtrx->rota2.y = mtrx->rota3.z = 1.0;
if (verbose_flag>1) fprintf(stderr, "EXTR chunk.\n");
while (len>0) {
get_name(name, 4, world);
size = get_ULONG(world);
len -= 8;
if (verbose_flag>1) fprintf(stderr, "%s chunk.\n", name);
if (strcmp(name, "MTRX")==0) {
stuff_XYZ(&mtrx->tran, world);
stuff_XYZ(&mtrx->scal, world);
stuff_XYZ(&mtrx->rota1, world);
stuff_XYZ(&mtrx->rota2, world);
stuff_XYZ(&mtrx->rota3, world);
} else
if (strcmp(name, "LOAD")==0) {
get_name(extr->filename, 80, world);
} else {
if (verbose_flag) output_warning(world, "EXTR ", name, size);
else {
for (i=size; i--; ) fgetc(world->inp); /* Skip this section */
}
}
if (size&1) { fgetc(world->inp); len--; } /* Skip odd byte */
len -= size;
}
/* Now, load in the external object */
if (!(newinp=fopen(extr->filename, "r"))) {
fprintf(stderr, "Can't load in EXTR object: '%s'... ignored.\n",
extr->filename);
return(obj);
}
new = read_World(newinp);
fclose(newinp);
/* scale, rotate, and translate new object hierarchy */
for (p=new->object; p; p=p->next)
move_extr(p, mtrx);
/* Free up unused memory */
free((char*)obj->extr);
free((char*)obj);
obj = new->object;
free((char*)new);
return(obj);
}
static UBYTE defclst[3], defrlst[3], deftlst[3], defspc1[3];
static void malloc_arrays(i, desc)
register int i;
register DESC *desc;
{
if (!desc->fcount) {
desc->fcount = i;
if (!(desc->face=(UWORD*)malloc(3*desc->fcount*sizeof(UWORD))))OUT_MEM((char*)0);
if (!(desc->clst=(UBYTE*)malloc(3*desc->fcount*sizeof(UBYTE))))OUT_MEM((char*)0);
if (!(desc->rlst=(UBYTE*)malloc(3*desc->fcount*sizeof(UBYTE))))OUT_MEM((char*)0);
if (!(desc->tlst=(UBYTE*)malloc(3*desc->fcount*sizeof(UBYTE))))OUT_MEM((char*)0);
/* Initialize arrays */
for (i=0; i<3*desc->fcount; i+=3) {
desc->face[i] = desc->face[i+1] = desc->face[i+2] = 0;
desc->clst[i] = defclst[0];
desc->clst[i+1] = defclst[1];
desc->clst[i+2] = defclst[2];
desc->rlst[i] = defrlst[0];
desc->rlst[i+1] = defrlst[1];
desc->rlst[i+2] = defrlst[2];
desc->tlst[i] = deftlst[0];
desc->tlst[i+1] = deftlst[1];
desc->tlst[i+2] = deftlst[2];
}
} else if (i != desc->fcount) {
fprintf(stderr, "ERROR: FACE and [C|R|T]LST 'Count' values inconsistant.\n");
OUT_MEM((char*)0);
}
}
static void process_DESC(len, orig, world)
register ULONG len;
DESC **orig;
WORLD *world;
{
register ULONG size;
register DESC *desc;
register int i, j;
FGRP *fgrp;
char name[5];
if (!(desc = *orig = (DESC*)malloc(sizeof(DESC))))
{ OUT_MEM("DESC"); }
bzero((char*)desc, sizeof(DESC));
/* Set up defaults: */
defclst[0] = defclst[1] = defclst[2] = 240; /* TS default */
defrlst[0] = defrlst[1] = defrlst[2] = 0;
deftlst[0] = deftlst[1] = deftlst[2] = 0;
defspc1[0] = defspc1[1] = defspc1[2] = 0;
world->num_DESC++;
if (verbose_flag>1) fprintf(stderr, "DESC chunk.\n");
while (len>0) {
get_name(name, 4, world);
size = get_ULONG(world);
len -= 8;
if (verbose_flag>1) fprintf(stderr, "%s chunk.\n", name);
if (strcmp(name, "NAME")==0) {
get_name(desc->name, 18, world);
} else
if (strcmp(name, "SHAP")==0) {
if (!desc->shap) {
if (!(desc->shap=(WORD*)malloc(2*sizeof(WORD))))
{ OUT_MEM("SHAP"); }
desc->shap[0] = 2; /* TS defaults */
desc->shap[1] = 0;
}
desc->shap[0] = get_UWORD(world);
desc->shap[1] = get_UWORD(world);
} else
if (strcmp(name, "POSI")==0) {
if (!desc->posi) {
if (!(desc->posi=(XYZ_st*)malloc(sizeof(XYZ_st))))
{ OUT_MEM("POSI"); }
}
stuff_XYZ(desc->posi, world);
} else
if (strcmp(name, "AXIS")==0) {
if (!desc->axis) {
if (!(desc->axis=(AXIS*)malloc(sizeof(AXIS))))
{ OUT_MEM("AXIS"); }
bzero((char*)desc->axis, sizeof(AXIS));
desc->axis->xaxi.x = 1;
desc->axis->yaxi.y = 1;
desc->axis->zaxi.z = 1;
}
stuff_XYZ(&desc->axis->xaxi, world);
stuff_XYZ(&desc->axis->yaxi, world);
stuff_XYZ(&desc->axis->zaxi, world);
} else
if (strcmp(name, "SIZE")==0) {
if (!desc->size) {
if (!(desc->size=(XYZ_st*)malloc(sizeof(XYZ_st))))
{ OUT_MEM("SIZE"); }
}
stuff_XYZ(desc->size, world);
} else
if (strcmp(name, "PNTS")==0) {
i = desc->pcount = get_UWORD(world); /* Number of points */
if (!(desc->pnts = (XYZ_st*)malloc(desc->pcount*sizeof(XYZ_st))))
OUT_MEM("PNTS");
for (j=0; j<i; j++)
{ stuff_XYZ(&desc->pnts[j], world); }
} else
if (strcmp(name, "EDGE")==0) {
i = desc->ecount = get_UWORD(world); /* Number of edges */
if (!(desc->edge = (UWORD*)malloc(2*desc->ecount*sizeof(UWORD))))
OUT_MEM("EDGE");
for (j=0; j<2*i; j++)
{ desc->edge[j] = get_UWORD(world); }
} else
if (strcmp(name, "EFLG")==0) {
if (!(desc->eflg = (EFLG*)malloc(sizeof(EFLG))))
OUT_MEM("EFLG");
i = desc->eflg->num = get_UWORD(world); /* Number of edge flags */
if (!(desc->eflg->eflg=(UBYTE*)malloc(desc->eflg->num*sizeof(UBYTE))))
OUT_MEM("EFLG");
for (j=0; j<i; j++)
{ desc->eflg->eflg[j] = get_UBYTE(world); }
} else
if (strcmp(name, "FACE")==0) {
i = get_UWORD(world); /* Number of faces */
malloc_arrays(i, desc);
for (j=0; j<i; j++) {
desc->face[3*j] = get_UWORD(world);
desc->face[3*j+1] = get_UWORD(world);
desc->face[3*j+2] = get_UWORD(world);
}
} else
if (strcmp(name, "FGRP")==0) {
if (!(fgrp = (FGRP*)malloc(sizeof(FGRP))))
OUT_MEM("FGRP");
i = fgrp->num = get_UWORD(world); /* Number of faces in group */
if (!(fgrp->face = (UWORD*)malloc(i*sizeof(UWORD))))
OUT_MEM("FGRP");
get_name(fgrp->name, 18, world);
for (j=0; j<i; j++)
fgrp->face[j] = get_UWORD(world);
/* Link this new FGRP into list */
fgrp->next = desc->fgrp;
desc->fgrp = fgrp;
} else
if (strcmp(name, "COLR")==0) {
if (!desc->colr) {
if (!(desc->colr = (RGB_st*)malloc(sizeof(RGB_st))))
{ OUT_MEM("COLR"); }
}
fgetc(world->inp); /* Must be zero */
stuff_RGB((RGB_st*)&defclst[0], world);
desc->colr->r = defclst[0];
desc->colr->g = defclst[1];
desc->colr->b = defclst[2];
} else
if (strcmp(name, "REFL")==0) {
if (!desc->refl) {
if (!(desc->refl = (RGB_st*)malloc(sizeof(RGB_st))))
{ OUT_MEM("REFL"); }
}
fgetc(world->inp); /* Must be zero */
stuff_RGB((RGB_st*)&defrlst[0], world);
desc->refl->r = defrlst[0];
desc->refl->g = defrlst[1];
desc->refl->b = defrlst[2];
} else
if (strcmp(name, "TRAN")==0) {
if (!desc->tran) {
if (!(desc->tran = (RGB_st*)malloc(sizeof(RGB_st))))
{ OUT_MEM("TRAN"); }
}
fgetc(world->inp); /* Must be zero */
stuff_RGB((RGB_st*)&deftlst[0], world);
desc->tran->r = deftlst[0];
desc->tran->g = deftlst[1];
desc->tran->b = deftlst[2];
} else
if (strcmp(name, "SPC1")==0) {
if (!desc->spc1) {
if (!(desc->spc1 = (RGB_st*)malloc(sizeof(RGB_st))))
{ OUT_MEM("SPC1"); }
}
fgetc(world->inp); /* Must be zero */
stuff_RGB((RGB_st*)&defspc1[0], world);
desc->spc1->r = defspc1[0];
desc->spc1->g = defspc1[1];
desc->spc1->b = defspc1[2];
} else
if (strcmp(name, "CLST")==0) {
i = get_UWORD(world); /* Number of faces */
malloc_arrays(i, desc);
for (j=0; j<i; j++)
{ stuff_RGB((RGB_st*)&desc->clst[3*j], world); }
} else
if (strcmp(name, "RLST")==0) {
i = get_UWORD(world); /* Number of faces */
malloc_arrays(i, desc);
for (j=0; j<i; j++)
{ stuff_RGB((RGB_st*)&desc->rlst[3*j], world); }
} else
if (strcmp(name, "TLST")==0) {
i = get_UWORD(world); /* Number of faces */
malloc_arrays(i, desc);
for (j=0; j<i; j++)
{ stuff_RGB((RGB_st*)&desc->tlst[3*j], world); }
} else
if (strcmp(name, "TPAR")==0) {
if (!desc->tpar) {
if (!(desc->tpar=(double*)malloc(16*sizeof(double))))
{ OUT_MEM("TPAR"); }
bzero((char*)desc->tpar, 16*sizeof(double));
}
for (i=0; i<16; i++)
desc->tpar[i] = get_FRACT(world);
} else
if (strcmp(name, "SURF")==0) {
if (!desc->surf) {
if (!(desc->surf=(UBYTE*)malloc(5*sizeof(UBYTE))))
{ OUT_MEM("SURF"); }
bzero((char*)desc->surf, 5*sizeof(UBYTE));
}
for (i=0; i<5; i++)
desc->surf[i] = get_BYTE(world);
} else
if (strcmp(name, "MTTR")==0) {
if (!desc->mttr) {
if (!(desc->mttr=(MTTR*)malloc(sizeof(MTTR))))
{ OUT_MEM("MTTR"); }
bzero((char*)desc->mttr, sizeof(MTTR));
}
desc->mttr->type = get_UBYTE(world);
desc->mttr->indx = (get_UBYTE(world)/100.0)+1.0;
} else
if (strcmp(name, "SPEC")==0) {
if (!desc->spec) {
if (!(desc->spec=(UBYTE*)malloc(2*sizeof(UBYTE))))
{ OUT_MEM("SPEC"); }
bzero((char*)desc->spec, 2*sizeof(UBYTE));
}
desc->spec[0] = get_UBYTE(world);
desc->spec[1] = get_UBYTE(world);
} else
if (strcmp(name, "PRP0")==0) {
if (!desc->prp0) {
if (!(desc->prp0=(UBYTE*)malloc(6*sizeof(UBYTE))))
{ OUT_MEM("PRP0"); }
bzero((char*)desc->prp0, 6*sizeof(UBYTE));
}
for (i=0; i<6; i++)
desc->prp0[i] = get_UBYTE(world);
} else
if (strcmp(name, "PRP1")==0) {
if (!desc->prp1) {
if (!(desc->prp1=(UBYTE*)malloc(8*sizeof(UBYTE))))
{ OUT_MEM("PRP1"); }
bzero((char*)desc->prp1, 8*sizeof(UBYTE));
}
for (i=0; i<8; i++)
desc->prp1[i] = get_UBYTE(world);
} else
if (strcmp(name, "INTS")==0) {
if (!desc->ints) {
if (!(desc->ints=(double*)malloc(sizeof(double))))
{ OUT_MEM("INTS"); }
}
*desc->ints = get_FRACT(world);
} else
if (strcmp(name, "INT1")==0) {
if (!desc->int1) desc->int1=(XYZ_st*)malloc(sizeof(XYZ_st));
if (!desc->int1) { OUT_MEM("INT1"); }
stuff_XYZ(desc->int1, world);
} else
if (strcmp(name, "STRY")==0) {
get_name(desc->stry->path, 18, world);
stuff_XYZ(&desc->stry->tran, world);
stuff_XYZ(&desc->stry->rota, world);
stuff_XYZ(&desc->stry->scal, world);
desc->stry->info = get_UWORD(world);
} else {
if (verbose_flag) output_warning(world, "DESC ", name, size);
else {
for (i=size; i--; ) fgetc(world->inp); /* Skip this section */
}
}
if (size&1) { fgetc(world->inp); len--; } /* Skip odd byte */
len -= size;
}
}